home *** CD-ROM | disk | FTP | other *** search
/ Power Programmierung 2 / Power-Programmierung CD 2 (Tewi)(1994).iso / gnu / djgpp / contrib / libgrx / ndrivers / pieces / chkvga.c < prev    next >
Encoding:
Text File  |  1993-12-06  |  1.0 KB  |  29 lines

  1. /**
  2.  ** CHKVGA.C ---- code fragment to check for VGA
  3.  **
  4.  ** Copyright (C) 1991 DJ Delorie, 24 Kirsten Ave, Rochester NH 03867-2954
  5.  ** Copyright (C) 1992 Csaba Biegl, 820 Stirrup Dr, Nashville, TN 37221
  6.  ** Copyright (C) 1993 Grzegorz Mazur, gbm@ii.pw.edu.pl
  7.  **
  8.  ** This file is distributed under the terms listed in the document
  9.  ** "copying.dj", available from DJ Delorie at the address above.
  10.  ** A copy of "copying.dj" should accompany this file; if not, a copy
  11.  ** should be available from where this file was obtained.  This file
  12.  ** may not be distributed without a verbatim copy of "copying.dj".
  13.  **
  14.  ** This file is distributed WITHOUT ANY WARRANTY; without even the implied
  15.  ** warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  16.  **/
  17.  
  18. int check_for_VGA(void)
  19. {
  20.     /* check for VGA by trying to read a DAC register */
  21.     _AX = 0x1015;
  22.     _BX = 0;        /* DAC index 0 == should be black */
  23.     _CX = 0xffff;
  24.     _DX = 0xffff;
  25.     geninterrupt(0x10);
  26.     return(((_CX != 0xffff) && (_DX != 0xffff)) ? 1 : 0);
  27. }
  28.  
  29.